"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toKebabCase = exports.commaSeparatedValues = void 0;
function commaSeparatedValues(arr, conjunction = 'and', ifempty = '') {
    const l = arr.length;
    if (!l)
        return ifempty;
    if (l < 2)
        return arr[0];
    if (l < 3)
        return arr.join(` ${conjunction} `);
    arr = arr.slice();
    arr[l - 1] = `${conjunction} ${arr[l - 1]}`;
    return arr.join(', ');
}
exports.commaSeparatedValues = commaSeparatedValues;
function toKebabCase(str) {
    if (!str) {
        return '';
    }
    return (str
        .replace(/[.,/#!$%^&*;:{}=\-_'"`~()]/g, '')
        .match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g) || [])
        .join('-')
        .toLowerCase();
}
exports.toKebabCase = toKebabCase;
